home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
-
-
- #include <GL/glx.h>
-
- #ifdef DEBUG3 /* Event processing debugging level */
- #define DEBUG
- #endif
-
- #ifdef DEBUG2 /* Toolkit debugging level */
- #define DEBUG
- #endif
-
- #ifdef DEBUG /* Window debugging level */
- #include <auxDebug.h>
- #endif
-
- /**************************************************************************
- * Global Limits
- **************************************************************************/
-
- #define MAX_ATTRIB 32
- #define NUM_MOUSE_BUTTONS 3
-
-
- /**************************************************************************
- * Enums
- **************************************************************************/
-
- enum {
- MINUS_ONE = -1, ZERO, ONE, TWO, THREE, FOUR,
- FIVE, SIX, SEVEN, EIGHT, NINE, TEN
- };
-
-
- /**************************************************************************
- * auxWindow - window structure
- **************************************************************************/
-
- typedef struct _auxWindow {
-
- GLint id;
- GLint x;
- GLint y;
- GLsizei width;
- GLsizei height;
-
- Colormap colormap;
- Window glxWindow;
- GLXContext glxContext;
- XVisualInfo *glxVisual;
-
- struct _auxWindow *prev;
- struct _auxWindow *next;
-
- } auxWindow;
-
-
- /**************************************************************************
- * auxState - Global state structure for windows
- **************************************************************************/
-
- typedef struct {
-
- /*
- * Generic X stuff ...
- */
-
- Display *display;
- Screen *screen;
- Window rootWindow;
- int screenNum;
- Colormap rgbColormap;
- Colormap indexColormap;
-
- /*
- * Program state variables
- */
-
- auxWindow *current;
- auxWindow *head;
- auxWindow *tail;
-
- } _auxState;
-
-
- /*************************************************************************
- * Mouse callback data structure - linked list refereced by mouse button
- * and mouse direction
- **************************************************************************/
-
- typedef struct _funcList {
-
- GLvoid (*func)( AUX_EVENTREC * );
-
- struct _funcList *prev;
- struct _funcList *next;
-
- } MouseFunc;
-
-
- /*************************************************************************
- * Key callback data structure - binary tree of functions referenced
- * by AUX key type.
- **************************************************************************/
-
- typedef struct _keyFunc {
-
- GLint key;
- GLvoid (*keyFunc)( GLvoid );
-
- struct _keyFunc *left;
- struct _keyFunc *right;
-
- } KeyFunc;
-
-
- /*************************************************************************
- * Font data structure - linked list index by a reference number referring
- * particular font of interest.
- **************************************************************************/
-
- typedef struct _fontInfo {
-
- GLint fontId;
- XFontStruct *xFontInfo;
- GLuint listBase;
- GLint firstChar;
-
- struct _fontInfo *prev;
- struct _fontInfo *next;
-
- } FontInfo;
-
-
- /*************************************************************************
- * Global variables
- **************************************************************************/
-
- #ifdef auxMain
- _auxState auxState;
- GLboolean auxInitCalled;
- GLint auxDevice;
- GLint auxValue;
- GLint auxMouseX;
- GLint auxMouseY;
- KeyFunc *keyHead;
- MouseFunc *mouseLoc;
- MouseFunc *mouseUp[NUM_MOUSE_BUTTONS] = { NULL, NULL, NULL };
- MouseFunc *mouseDown[NUM_MOUSE_BUTTONS] = { NULL, NULL, NULL };
- FontInfo *fontHead;
- #else
- extern _auxState auxState;
- extern GLboolean auxInitCalled;
- extern GLint auxDevice;
- extern GLint auxValue;
- extern GLint auxMouseX;
- extern GLint auxMouseY;
- extern KeyFunc *keyHead;
- extern MouseFunc *mouseLoc;
- extern MouseFunc *mouseUp[NUM_MOUSE_BUTTONS];
- extern MouseFunc *mouseDown[NUM_MOUSE_BUTTONS];
- extern FontInfo *fontHead;
- extern GLvoid auxQuit( GLvoid );
- #endif
-
-
- /**************************************************************************
- * aux Library Private Function Prototypes
- **************************************************************************/
-
- GLvoid auxInit( GLvoid );
- auxWindow *auxGetWindow( GLint );
- GLvoid auxCleanup( GLvoid );
-